﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<UserInput>" %>
<%@ Import Namespace="Kanban.Dto"%>
<%@ Import Namespace="MvcContrib.FluentHtml"%>
<%@ Import Namespace="WebUI.Controllers"%>
<%@ Import Namespace="Microsoft.Web.Mvc"%>
<%@ Import Namespace="KanbanBoard.Core"%>

<% if (ViewContext.TempData[GlobalEnums.TempDataProperty.PageMessage.ToString()] != null) { %>
    <p id="pageMessage"><%= ViewContext.TempData[GlobalEnums.TempDataProperty.PageMessage.ToString()]%></p>
<% } %>

<%= Html.ValidationSummary() %>

<% using (Html.BeginForm()) { %>
    <%= Html.AntiForgeryToken() %>
    <%= Html.HiddenFor(x => x.Id) %>

        	<label for="LoginName">LoginName:</label>
				<%= Html.TextBox("LoginName", 
					(ViewData.Model != null) ? ViewData.Model.LoginName : "")%>
			<%= Html.ValidationMessage("LoginName")%>
			
			<label for="FirstName">FirstName:</label>
				<%= Html.TextBox("FirstName", 
					(ViewData.Model != null) ? ViewData.Model.FirstName : "")%>
			<%= Html.ValidationMessage("FirstName")%>
			
			<label for="Surname">Surname:</label>
				<%= Html.TextBox("Surname", 
					(ViewData.Model != null) ? ViewData.Model.Surname : "")%>
			<%= Html.ValidationMessage("Surname")%>
			
			<label for="Password">Password:</label>
				<%= Html.TextBox("Password", 
					(ViewData.Model != null) ? ViewData.Model.Password : "")%>
			<%= Html.ValidationMessage("Password")%>
			
			<%= this.Select("Gender").Attr("size", 1).Options<Gender>()%>
			<%= Html.ValidationMessage("Gender")%>

            <%= Html.SubmitButton("btnSave", "Save") %>
	        <%= Html.Button("btnCancel", "Cancel", HtmlButtonType.Button, 
				    "window.location.href = '" + Html.BuildUrlFromExpression<UserController>(c => c.Index(null)) + "';") %>
<% } %>


